﻿using Transformable_Engine_v2.Engine.Global;

namespace Transformable_Engine_v2.Engine.Animation.Queue
{
    public class LoopingAnimationQueue : AnimationQueue
    {
        public LoopingAnimationQueue(double delay, bool autoStart, params BaseAnimation[] animations) : base(delay, autoStart, animations)
        {
        }

        protected override void ChangeCurrentAnimationIndex()
        {
            Log.LogDebug("Changing frame");

            CurrentAnimation = (CurrentAnimation + 1) % Animations.Length;
            
            Animations[CurrentAnimation].Reset();
        }
    }
}